/*
 * Copyright (c) 2007-2020 西安交通信息投资营运有限公司 版权所有
 */

package com.xci.edu.module.background.controller;
import com.github.lvyanyang.annotation.Authorize;
import com.github.lvyanyang.core.BaseWebController;
import com.github.lvyanyang.core.BoolResult;
import com.github.lvyanyang.core.XCI;
import com.xci.edu.core.entity.EduStudentTrainLog;
import com.xci.edu.core.filter.EduStudentTrainLogFilter;
import com.xci.edu.core.service.EduStudentTrainLogService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 学员培训日志页面控制器
 * @author 张谦 zhangqian@xci96716.com
 * @since 2020-11-25 09:35:56
 */
@Authorize
@Controller
@RequestMapping(value = "/background/eduStudentTrainLog")
public class EduStudentTrainLogController extends BaseWebController {
    /** 学员培训日志服务 */
    @Resource private EduStudentTrainLogService eduStudentTrainLogService;

    //region 页面

    /** 首页 */
    @GetMapping
    @Authorize(code = "background.eduStudentTrainLog")
    public String index() {
        return "background/eduStudentTrainLog/index";
    }

    //endregion

    //region 处理

    /** 表格查询 */
    @ResponseBody
    @PostMapping("/grid")
    @Authorize(code = "background.eduStudentTrainLog.select")
    public BoolResult grid(EduStudentTrainLogFilter filter) {
        return BoolResult.success(eduStudentTrainLogService.selectPageList(filter));
    }

    /** 导出 */
    @GetMapping("/export")
    @Authorize(code = "background.eduStudentTrainLog.export")
    public void export(EduStudentTrainLogFilter filter) {
        XCI.exportExcel(eduStudentTrainLogService.selectList(filter), EduStudentTrainLog.class, "学员培训日志列表");
    }

    //endregion
}